package com.chis.netty.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 
 * @Description 
 * @Company zwx
 * @author wlj
 * @version 2019年12月22日
 */
public class ConfigProperVal {
    private static ConfigProperVal singletoninstance = new ConfigProperVal();
    private static Properties prop;

    private ConfigProperVal() {
        prop = new Properties();
        // 读取文件
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("nettyHttpConfig.properties");
        try {
            prop.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static ConfigProperVal getInstance(){
        return singletoninstance;
    }

    public String getConfiVal(String cfgname){
        return (String) prop.get(cfgname);
    }
}
